﻿<%@ Page Title="MakeOrder" Language="C#" AutoEventWireup="true" MasterPageFile="~/Site.Master" CodeBehind="MakeOrder.aspx.cs" Inherits="CarRental.View.Order.MakeOrder" %>

<asp:Content runat="server" ID="BodyContent" ContentPlaceHolderID="MainContent">
    <link rel="stylesheet" type="text/css" href="../../js/My97DatePicker/skin/WdatePicker.css" />
    <link href="../../js/My97DatePicker/skin/WdatePicker.css" rel="stylesheet" type="text/css">
    <script type="text/javascript" src="../../js/My97DatePicker/WdatePicker.js" charset="gb2312"></script>
    <form runat="server" id="SearchCar">
        <fieldset>
            <legend>Search Car</legend>
            <table id="t_searchcar" runat="server">
                <tr>
                    <td>
                        <asp:Label ID="lb_Color" runat="server" AssociatedControlID="ddlColor">Color</asp:Label>
                        <asp:DropDownList ID="ddlColor" runat="server" Width="200px" Height="25px"></asp:DropDownList>
                    </td>
                    <td>
                        <asp:Label ID="lb_type" runat="server" AssociatedControlID="ddlCarType">Car Type</asp:Label>
                        <asp:DropDownList ID="ddlCarType" runat="server" Width="200px" Height="25px"></asp:DropDownList>
                    </td>
                    <td>
                        <asp:Label ID="lb_depot" runat="server" AssociatedControlID="ddlDepot">Depot</asp:Label>
                        <asp:DropDownList ID="ddlDepot" runat="server" Width="200px" Height="25px"></asp:DropDownList>
                    </td>
                    <td>
                        <asp:Label ID="lb_drivetrains" runat="server" AssociatedControlID="ddlDrivetrains">Drivetrains</asp:Label>
                        <asp:DropDownList ID="ddlDrivetrains" runat="server" Width="200px" Height="25px"></asp:DropDownList>
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:Label ID="lblShop" runat="server" AssociatedControlID="ddlShop">Shop</asp:Label>
                        <asp:DropDownList ID="ddlShop" runat="server" Width="200px" Height="25px"></asp:DropDownList>
                    </td>
                    <td>
                        <asp:Label ID="lblRentFDate" runat="server" AssociatedControlID="tbRentFDate">Rent from date</asp:Label>
                        <asp:TextBox ID="tbRentFDate" onclick="WdatePicker();" runat="server" Width="200px" Height="25px"></asp:TextBox>
                    </td>
                    <td>
                        <asp:Label ID="lblRentTDate" runat="server" AssociatedControlID="tbRentTDate">Rent from date</asp:Label>
                        <asp:TextBox ID="tbRentTDate" onclick="WdatePicker();" runat="server" Width="200px" Height="25px"></asp:TextBox>
                    </td>
                    <td>
                        <%-- <asp:Button ID="btn_AddCart" runat="server" Text="Continue To Book" OnClick="btn_AddCart_Click" />--%>
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:Button runat="server" ID="btnSearchCar" Text="Search Car" Width="116px" OnClick="btnSearchCar_Click" />
                        <asp:Label ID="lblWarning" runat="server" Font-Size="Larger" ForeColor="Red"></asp:Label>
                    </td>
                </tr>
                <tr>
                    <td colspan="4">
                        <asp:GridView ID="gvCarLst" runat="server" AutoGenerateColumns="False" DataKeyNames="id,car_no,car_model,car_typecode,depot,drivetrains,color,status,buy_in_date,buy_in_cost,rent_price,last_rental_date,last_rental_order_no,number_of_rental,shopcode,shopname,car_type,depot_name,drivetrains_name" OnRowCommand="gvCarLst_RowCommand">
                            <Columns>

                                <asp:BoundField DataField="car_no" HeaderText="car_no" ReadOnly="True" SortExpression="car_no"></asp:BoundField>
                                <asp:BoundField DataField="car_model" HeaderText="car_model" ReadOnly="True" SortExpression="car_model" />
                                <asp:BoundField DataField="car_type" HeaderText="car_type" ReadOnly="True" SortExpression="car_type" />
                                <asp:BoundField DataField="depot_name" HeaderText="depot_name" ReadOnly="True" SortExpression="depot_name" />
                                <asp:BoundField DataField="drivetrains_name" HeaderText="drivetrains_name" ReadOnly="True" SortExpression="drivetrains_name" />
                                <asp:BoundField DataField="color" HeaderText="color" ReadOnly="True" SortExpression="color" />
                                <asp:BoundField DataField="rent_price" HeaderText="rent_price" ReadOnly="True" SortExpression="rent_price" />
                                <asp:BoundField DataField="shopname" HeaderText="Shop" />
                                <asp:ButtonField ButtonType="Button" CommandName="Order" Text="Order" />
                            </Columns>
                        </asp:GridView>



                        <asp:EntityDataSource ID="EntityDataSource_SearchCar" runat="server" ConnectionString="name=car_rental_dbEntities" DefaultContainerName="car_rental_dbEntities" EnableFlattening="False" EntitySetName="vwcar" EntityTypeFilter="vwcar" Where="" AutoGenerateWhereClause="True">
                            <WhereParameters>
                                <asp:ControlParameter ControlID="ddlColor" Name="color" PropertyName="SelectedValue" />
                                <asp:ControlParameter ControlID="ddlDepot" Name="depot" PropertyName="SelectedValue" />
                                <asp:ControlParameter ControlID="ddlDrivetrains" Name="drivetrains" PropertyName="SelectedValue" />
                                <asp:ControlParameter ControlID="ddlCarType" Name="car_typecode" PropertyName="SelectedValue" />
                                <asp:ControlParameter ControlID="ddlShop" Name="shopcode" PropertyName="SelectedValue" />
                            </WhereParameters>
                        </asp:EntityDataSource>

                    </td>
                </tr>
                <tr>
                    <td colspan="4" align="right">
                       <%-- <asp:Button ID="btn_AddCart" runat="server" Text="Continue To Book" OnClick="btn_AddCart_Click" />--%>
                    </td>
                </tr>
            </table>
        </fieldset>
    </form>
</asp:Content>
